package com.xiangxiao.rpan.storage.param;

import com.xiangxiao.rpan.storage.anotion.StorageParamItem;
import com.xiangxiao.rpan.storage.enums.StorageParamTypeEnum;
import com.xiangxiao.rpan.storage.params.IStorageParam;
import lombok.Getter;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2023/11/10 14:29
 */
@Getter
public class CosParam implements IStorageParam {
  @StorageParamItem(name = "AccessKey", defaultValue = "AKIDkS6e8c5eCqV1OkEcv7kQvkX9jJpaFoJk", order = 1)
  private String accessKey;

  @StorageParamItem(name = "SecretKey", defaultValue = "RfjdM5hcUTXCqS0aDtX9mHeyCLOH7541", order = 2)
  private String secretKey;

  @StorageParamItem(name = "区域", defaultValue = "ap-chengdu", order = 3, description = "如下拉列表中没有的区域，或想使用内网地址，可直接输入后回车，如: xxx-cn-beijing.example.com")
  private String endPoint;

  @StorageParamItem(name = "存储空间名称", defaultValue = "xiangxiao-1257911532", order = 4)
  private String bucketName;

  @StorageParamItem(name = "Bucket 域名 / CDN 加速域名", defaultValue = "ap-chengdu", required = false, order = 5)
  private String domain;

  @StorageParamItem(name = "基路径", order = 6, required = false, defaultValue = "/root/rpan/cos", description = "基路径表示读取的根文件夹，不填写表示允许读取所有。如： '/'，'/文件夹1'")
  private String filePath;

  @StorageParamItem(name = "是否是私有空间", order = 7, type = StorageParamTypeEnum.SWITCH, defaultValue = "true", description = "私有空间会生成带签名的下载链接")
  private boolean isPrivate;

  @StorageParamItem(name = "下载签名有效期", required = false, defaultValue = "1800", description = "当为私有空间时, 用于下载签名的有效期, 单位为秒, 如不配置则默认为 1800 秒.")
  private Integer tokenTime;

  @StorageParamItem(name = "是否自动配置 CORS 跨域设置", order = 100, type = StorageParamTypeEnum.SWITCH, defaultValue = "true",
      description = "如不配置跨域设置，可能会无法导致无法上传，或上传后看不到文件（某些 S3 存储无需配置此选项，如 Cloudflare R2、Oracle 对象存储）")
  private boolean autoConfigCors;

}
